package com.yan.demo4;

/**
 * @author taoge
 * @Date 2024/8/9 11:17
 * @Description
 */
public class MyTask implements Runnable{
    private MyThreadLocal myThreadLocal = new MyThreadLocal();
    @Override
    public void run() {
        Student student = myThreadLocal.get();

        student.setName(Thread.currentThread().getName());

        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        System.out.println(Thread.currentThread().getName());

    }
}
